/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package escr.persistencia;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Aditardo
 */
@Entity
@Table(name = "paises")
@NamedQueries({@NamedQuery(name = "Paises.findByPaiId", query = "SELECT p FROM Paises p WHERE p.paiId = :paiId"), @NamedQuery(name = "Paises.findByPaiNombre", query = "SELECT p FROM Paises p WHERE p.paiNombre = :paiNombre")})
public class Paises implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "PAI_ID", nullable = false)
    private String paiId;
    @Column(name = "PAI_NOMBRE", nullable = false)
    private String paiNombre;

    public Paises() {
    }

    public Paises(String paiId) {
        this.paiId = paiId;
    }

    public Paises(String paiId, String paiNombre) {
        this.paiId = paiId;
        this.paiNombre = paiNombre;
    }

    public String getPaiId() {
        return paiId;
    }

    public void setPaiId(String paiId) {
        this.paiId = paiId;
    }

    public String getPaiNombre() {
        return paiNombre;
    }

    public void setPaiNombre(String paiNombre) {
        this.paiNombre = paiNombre;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (paiId != null ? paiId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Paises)) {
            return false;
        }
        Paises other = (Paises) object;
        if ((this.paiId == null && other.paiId != null) || (this.paiId != null && !this.paiId.equals(other.paiId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "escr.persistencia.Paises[paiId=" + paiId + "]";
    }

}
